<template>
	<div>
		<el-dialog title="查看详情" width="800px" @open="open" class="icon-dialog" :visible.sync="show" :before-close="closeForm" append-to-body>
			<table class="table table-bordered" align="center" width="100%" style="word-break:break-all; margin-bottom:50px;  font-size:13px;">
				<tbody>
				 <tr>
						<td class="title" width="100">{{$t('field.Parameter_id')}}：</td>
						<td>
							{{form.id}}
						</td>
				 </tr>
				 <tr>
						<td class="title" width="100">{{$t('field.Parameter_name')}}：</td>
						<td>
							{{form.name}}
						</td>
				 </tr>
				 <tr>
						<td class="title" width="100">{{$t('field.Parameter_module')}}：</td>
						<td>
							{{form.module}}
						</td>
				 </tr>
				 <tr>
						<td class="title" width="100">{{$t('field.Parameter_title')}}：</td>
						<td>
							{{form.title}}
						</td>
				 </tr>
				<tr>
						<td class="title" width="100">{{$t('field.Parameter_language')}}：</td>
						<td>
							{{form.language}}
						</td>
				</tr>
				 <tr>
						<td class="title" width="100">{{$t('field.Parameter_tip')}}：</td>
						<td>
							{{form.tip}}
						</td>
				 </tr>
				<tr>
						<td class="title" width="100">{{$t('field.Parameter_type')}}：</td>
						<td>
							<span v-if="form.type == 'string'">文本</span>
							<span v-if="form.type == 'bool'">布尔类型</span>
							<span v-if="form.type == 'int'">数字</span>
							<span v-if="form.type == 'image'">图片</span>
							<span v-if="form.type == 'file'">文件</span>
							<span v-if="form.type == 'array'">数组</span>
							<span v-if="form.type == 'datetime'">日期</span>
							<span v-if="form.type == 'json'">JSON</span>
							<span v-if="form.type == 'richtext'">富文本</span>
							<span v-if="form.type == 'longtext'">多行文字</span>
						</td>
				</tr>
				<tr>
						<td class="title" width="100">{{$t('field.Parameter_value')}}：</td>
						<td>
							<el-image v-if="form.value" class="table_list_pic" :src="form.value"  :preview-src-list="[form.value]"></el-image>
						</td>
				</tr>
				<tr>
						<td class="title" width="100">{{$t('field.Parameter_content')}}：</td>
						<td>
							{{form.content}}
						</td>
				 </tr>
				 <tr>
						<td class="title" width="100">{{$t('field.Parameter_rule')}}：</td>
						<td>
							{{form.rule}}
						</td>
				 </tr>
				 <tr>
						<td class="title" width="100">{{$t('field.Parameter_extend')}}：</td>
						<td>
							{{form.extend}}
						</td>
				 </tr>
				 <tr>
						<td class="title" width="100">{{$t('field.Parameter_remark')}}：</td>
						<td>
							{{form.remark}}
						</td>
				 </tr>
				</tbody>
			</table>
		</el-dialog>
	</div>
</template>
<script>
import { detail } from '@/api/admin/parameter'
export default {
	name:'parameterdetail',
	props: {
		show: {
			type: Boolean,
			default: true
		},
		size: {
			type: String,
			default: 'mini'
		},
		info: {
			type: Object,
		},
	},
	data() {
		return {
			form:{
			},
		}
	},
	methods: {
		open(){
			detail(this.info).then(res => {
				this.form = res.data
			})
		},
		closeForm(){
			this.$emit('update:show', false)
		}
	}
}
</script>
<style  lang="scss">
@import '@/assets/scss/common.scss'
</style>
